//
//  CustomMapModel.m
//  NBTripe
//
//  Created by 陈曦 on 16/1/18.
//  Copyright © 2016年 Vicki. All rights reserved.
//

#import "CustomMapModel.h"
#import "CoveredCountriesModel.h"

@implementation CustomMapModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"covered_countries"]) {
        NSMutableArray *array  = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in value) {
            CoveredCountriesModel *ccModel = [[CoveredCountriesModel alloc] initWithDataSource:dic];
            [array addObject:ccModel];
        }
        self.coveredCountriesArray = [NSArray arrayWithArray:array];
    }
    if ([key isEqualToString:@"user"]) {
        self.userModel = [[UserModel alloc] initWithDataSource:value];
    }
    
}

@end
